All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.util.URLContentsImpl
java.lang.Object
|
+----sun.server.util.URLContentsImpl
- public class URLContentsImpl
- extends Object
- implements URLContents
This represents the interface to one disk cache entry in the
DiskCache object. A list of such entries form the disk cache.
-
CE_DATA_BEING_FETCHED
-
-
CE_DATA_BEING_FILLED
-
-
CE_EMPTY
-
-
CE_FWRITE_FAILED
-
-
CE_READY
-
-
URLContentsImpl()
-
-
URLContentsImpl(DiskCacheImpl, URL, String, int)
-
-
URLContentsImpl(DiskCacheImpl, URL, String, int, int, String, long, long)
-
-
URLContentsImpl(URLConnection)
-
-
URLContentsImpl(URLContents)
-
-
available()
- Check if the contents in this URLContents is ready for
reading or is in the process of being fetched.
-
cacheable()
-
-
cacheHit()
- This indicates that the URLContents is being accessed.
-
getContentLength()
- The content length of the data on the input stream.
-
getContents()
- This is the input stream from which the contents of the
URL to be stored or the URL being retrieved is read.
-
getContentType()
- The mime type of the contents that is referred to by the URL.
-
getHeaders()
- return all the HTTP headers in a hash table format.
-
getLastModifiedDate()
- The last modified date on the URL.
-
getResponseCode()
-
-
getResponseMessage()
-
-
getURL()
- The URL that identifies these contents.
-
lastAccessTime()
- This is the time of last access on this URL.
-
numHits()
- when the URL is being read from the cache, this represents the
number of times the URL has been read since being stored in the
cache.
-
setCacheable(boolean)
-
-
setContents(URLContents)
-
-
setDate(long)
-
-
setHeaders(Hashtable)
- Set the header table.
-
setInputStream(InputStream)
-
-
setLength(int)
-
-
setResponseCode(int)
-
-
setResponseMessage(String)
-
-
setType(String)
-
-
setUrl(URL)
-
CE_EMPTY
public static final int CE_EMPTY
CE_DATA_BEING_FILLED
public static final int CE_DATA_BEING_FILLED
CE_DATA_BEING_FETCHED
public static final int CE_DATA_BEING_FETCHED
CE_READY
public static final int CE_READY
CE_FWRITE_FAILED
public static final int CE_FWRITE_FAILED
URLContentsImpl
public URLContentsImpl(URLConnection uc) throws IOException
URLContentsImpl
public URLContentsImpl(DiskCacheImpl dc,
URL url,
String file,
int entrySize)
URLContentsImpl
public URLContentsImpl(DiskCacheImpl dc,
URL url,
String file,
int entrySize,
int len,
String type,
long lmtime,
long lattime)
URLContentsImpl
public URLContentsImpl(URLContents uc)
URLContentsImpl
public URLContentsImpl()
setContents
public synchronized void setContents(URLContents uc)
setUrl
public void setUrl(URL url)
setInputStream
public void setInputStream(InputStream is)
setLength
public void setLength(int len)
setType
public void setType(String type)
setDate
public void setDate(long date)
getURL
public URL getURL()
- The URL that identifies these contents.
getContentLength
public int getContentLength()
- The content length of the data on the input stream. If a
-1 is returned, the length is until EOF is read on the input
stream.
getContentType
public String getContentType()
- The mime type of the contents that is referred to by the URL.
getLastModifiedDate
public long getLastModifiedDate()
- The last modified date on the URL. The date is represented as
the number of miliseconds since Jan 1, 1970.
getResponseCode
public int getResponseCode()
getResponseMessage
public String getResponseMessage()
setResponseCode
public void setResponseCode(int code)
setResponseMessage
public void setResponseMessage(String msg)
cacheable
public boolean cacheable()
setCacheable
public void setCacheable(boolean b)
setHeaders
public void setHeaders(Hashtable h)
- Set the header table.
The key is the header name, the value is the header value.
getHeaders
public Hashtable getHeaders()
- return all the HTTP headers in a hash table format.
The key is the header name, the value is the header value.
numHits
public int numHits()
- when the URL is being read from the cache, this represents the
number of times the URL has been read since being stored in the
cache.
lastAccessTime
public long lastAccessTime()
- This is the time of last access on this URL. It is represented
in seconds since Jan 1, 1970.
cacheHit
public void cacheHit()
- This indicates that the URLContents is being accessed.
When the URLContents object is cached, whenever the object is
referred to from the application, this method must be called, so
that the last accessed time and the number of hits can be updated.
getContents
public synchronized InputStream getContents() throws IOException
- This is the input stream from which the contents of the
URL to be stored or the URL being retrieved is read.
- Returns:
- the input stream from which contents of the URL is read
available
public boolean available()
- Check if the contents in this URLContents is ready for
reading or is in the process of being fetched.
- Returns:
- true iff the data is ready for reading
All Packages Class Hierarchy This Package Previous Next Index